              <div align="right">
${TARGET="offline"}                <a href="${LDAP_SDK_HOME_URL}" style="font-size: 85%">LDAP SDK Home Page</a>
${TARGET="offline"}                <br>
                <a href="${BASE}index.${EXTENSION}" style="font-size: 85%">Product Information</a>
                <br>
                <a href="index.${EXTENSION}" style="font-size: 85%">Getting Started with the LDAP SDK</a>
              </div>

              <h2>LDIF Processing</h2>

              <p>
                The UnboundID LDAP SDK for Java contains a number of classes that may be used for
                reading and writing entries and change records in the LDAP Data Interchange Format
                (LDIF), as specified in RFC 2849.  LDIF provides a simple text-based mechanism for
                representing entries and change records.
              </p>

              <p></p>
              <h3>Encoding an Entry in LDIF</h3>

              <p>
                The <tt>com.unboundid.ldap.sdk.Entry</tt> object provides the following methods for
                representing that entry in LDIF form:
              </p>

              <ul>
                <li>
                  <tt>public String[] toLDIF()</tt> -- Retrieves an array of the lines that make up
                  the LDIF representation of an entry.
                  <br><br>
                </li>

                <li>
                  <tt>public String toLDIFString()</tt> -- Retrieves a string representation of the
                  entry in LDIF form.  The returned string will include line breaks.
                  <br><br>
                </li>

                <li>
                  <tt>public void toLDIFString(StringBuilder buffer)</tt> -- Appends an LDIF string
                  representation of the entry, including line breaks, to the provided
                  <tt>StringBuilder</tt> object.
                  <br><br>
                </li>
              </ul>

              <p>
                In each of the above methods, no wrapping will be performed for long lines.
              </p>

              <p>
                Also note that it is possible to construct an entry from an LDIF representation.
                This can be done using the <tt>Entry(String... entryLines)</tt> constructor, like:
              </p>

              <pre>
Entry e = new Entry(
  "dn: dc=example,dc=com",
  "objectClass: top",
  "objectClass: domain",
  "dc: example");
</pre>

              <p></p>
              <h3>LDIF Change Records</h3>

              <p>
                Add, delete, modify, and modify DN operations can also be represented in LDIF form,
                and the LDAP SDK provides <tt>LDIFAddChangeRecord</tt>,
                <tt>LDIFDeleteChangeRecord</tt>, <tt>LDIFModifyChangeRecord</tt>, and
                <tt>LDIFModifyDNChangeRecord</tt> classes (and their <tt>LDIFChangeRecord</tt>
                superclass) for interacting with them.  Change records may be created from their
                corresponding request type (e.g., if you have a <tt>ModifyRequest</tt> object, you
                can use that to create an <tt>LDIFModifyChangeRecord</tt> object), and the same set
                of <tt>toLDIF</tt> and <tt>toLDIFString</tt> methods are available for obtaining
                the LDIF representation of those change records.
              </p>

              <p>
                Further, it is possible to create <tt>LDAPRequest</tt> objects from
                <tt>LDIFChangeRecord</tt> objects.  For example, the
                <tt>LDIFDeleteChangeRecord.toDeleteRequest</tt> method may be used to create a
                <tt>DeleteRequest</tt> object.  In addition, all change record types include a
                <tt>processChange(LDAPConnection connection)</tt> method that can be used to
                process the operation over the provided connection.
              </p>

              <p></p>
              <h3>Reading Entries and Change Records from LDIF</h3>

              <p>
                The <tt>LDIFReader</tt> class provides a means of reading data from a file or input
                stream and parsing that data into LDIF entries or change records.  In particular,
                the <tt>readEntry()</tt> method will read an LDIF entry, and the
                <tt>readChangeRecord</tt> method will read a change record.  If these methods
                return <tt>null</tt>, then it means that the end of the LDIF data has been reached.
                At that point, the LDIF reader may be closed using the <tt>close</tt> method.
              </p>

              <p>
                In addition, the <tt>LDIFReader</tt> class provides static
                <tt>decodeEntry(String... ldifLines)</tt> and
                 <tt>decodeChangeRecord(String... ldifLines)</tt> so that it is possible to decode
                 the contents of a string array as an entry or change record without the need to
                 read the data from a file or input stream.
              </p>

              <p></p>
              <h3>Writing Entries and Change Records to LDIF</h3>

              <p>
                The <tt>LDIFWriter</tt> class provides a means of writing entries and change
                records in LDIF form to a specified file or output stream.  It also provides the
                option to wrap long lines at a specified column width.
              </p>

              <p>
                To write an entry in LDIF form, use either the <tt>writeEntry(Entry entry)</tt> or
                <tt>writeEntry(Entry entry, String comment)</tt> methods to write the provided
                entry and optionally include a comment immediately preceding the entry.  Similarly,
                the <tt>writeChangeRecord(LDIFChangeRecord changeRecord)</tt> and
                <tt>writeChangeRecord(LDIFChangeRecord changeRecord, String comment)</tt> provide a
                means of writing change records, optionally immediately preceded by a comment.  The
                <tt>close</tt> method should be used to close the LDIF writer when all entries
                and/or change records have been written.
              </p>
